<?php
/**
 * Create by PhpStorm
 * User: lijia
 * Data: 2020/8/10
 * Time: 10:52
 */

namespace app\api\business;


use app\api\controller\Common;
use app\api\model\Ad;
use think\facade\Request;

class AdBus extends Common
{
    public $model;
    public function __construct()
    {
        $this->model = new Ad();
    }

    public function get($where){
        $list = $this->model->where($where)->field('ad_id,image,goods_id')->select()->toArray();
        foreach ($list as $k => $v) {
            $list[$k]['image'] = Request::scheme().'://' . Request::host() . $v['image'];
        }
        return $list;
    }
}










